package jintaiyujukuai;

public class TestDriver3 {
    public static void main(String[] args) {

        //执行输出代码内容
        System.out.println("Person类和Student类优先执行静态语句块");
        new Student();//优先执行静态语句块
        System.out.println();

        System.out.println("-----------------------------");

        System.out.println("不执行静态语句块，静态语句块只执行一次");
        new Student();//静态语句块只执行一次
        System.out.println();

        System.out.println("----------父类指代子类-----------");

        Person person = new Student();//父类指代子类

        System.out.println("perName = "+person.perName);//父类的成员变量

    }

}
